package cn.iocoder.yudao.module.trade.service.lifecircle;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.module.trade.controller.admin.lifecircle.vo.LifeCircleStoreTypePageReqVO;
import cn.iocoder.yudao.module.trade.dal.dataobject.lifecircle.LifeCircleStoreTypeDO;
import cn.iocoder.yudao.module.trade.dal.mysql.lifecircle.LifeCircleStoreTypeMapper;
import jakarta.annotation.Resource;
import org.springframework.stereotype.Service;

/**
 * @author : Jie.Gu
 * @version 1.0
 * @date 2025/3/19 15:21
 * @description
 */
@Service
public class LifeCircleStoreTypeServiceImpl implements LifeCircleStoreTypeService {

    @Resource
    private LifeCircleStoreTypeMapper lifeCircleStoreTypeMapper;


    @Override
    public Long createLifeCircleStore(LifeCircleStoreTypeDO lifeCircleStoreType) {
        lifeCircleStoreTypeMapper.insert(lifeCircleStoreType);
        return lifeCircleStoreType.getId();
    }

    @Override
    public void updateLifeCircleStore(LifeCircleStoreTypeDO lifeCircleStoreType) {
        lifeCircleStoreTypeMapper.updateById(lifeCircleStoreType);
    }

    @Override
    public void deleteLifeCircleStore(Long id) {
        lifeCircleStoreTypeMapper.deleteById(id);
    }

    @Override
    public LifeCircleStoreTypeDO getLifeCircleStore(Long id) {
        return lifeCircleStoreTypeMapper.selectById(id);
    }

    @Override
    public PageResult<LifeCircleStoreTypeDO> getLifeCircleStorePage(LifeCircleStoreTypePageReqVO lifeCircleStoreType) {
        return lifeCircleStoreTypeMapper.selectPage(lifeCircleStoreType);
    }
}
